namespace Example.Web
{
    using System;
    using System.Xml.Serialization;
    using SimpleWebServices.Web.UI.Html;
    using SimpleWebServices.Web.UI.Html.Elements;

    [XmlRoot("span")]
    public sealed class AsterixSpan : Span
    {
        public AsterixSpan()
        {
            this.Class = "error";
            this.Elements.Add(new TextString("* "));
        }

        public override IElement Deserialize(string name, string type, string xml)
        {
            IElement result = null;

            if ("span".Equals(name, StringComparison.OrdinalIgnoreCase))
            {
                if ("asterix".Equals(type, StringComparison.OrdinalIgnoreCase))
                {
                    result = this;
                }
            }

            return result;
        }
    }
}